
const Router = require("koa-router");

const router =  new Router();

const db = require("../db");

router.get("/api/banner",async (ctx,next)=>{
        let data = await db.select(`select * from indexbanner`);
        ctx.body = {
        	code:0,
        	data:data
        }
})


router.get("/api/recommend",async (ctx,next)=>{
        let data = await db.select(`select * from recommend`);
        ctx.body = {
        	code:0,
        	data:data
        }
})

router.get("/api/activity",async (ctx,next)=>{
        let data = await db.select(`select * from activity`);
        ctx.body = {
                code:0,
                data:data
        }
})



module.exports = router;